<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org" >
<!--/*@thymesVar id="k1" type=""*/-->
<head>
    <meta charset="UTF-8">
    <title>公共登录提示页</title>
</head>
<body>
<div id="idtest" th:fragment="ftest">
<!--说明未登录,不允许访问当前页面-->
<span th:if="${session.user eq null }">
    权限不足,请先登录,<span id="info"></span>秒后自动跳转登录页 <a href="index" >点击登录</a>
    <script type="text/javascript">
    var i = 5;
    function mytime(){
        //alert(i);
        document.getElementById("info").innerHTML="("+i +")";
        i--;
        if(i == -1){
            window.location.href="index";
            return;
        }
        window.setTimeout("mytime()",1000);
    }
    mytime();
</script>

</span>
<span th:if="${session.user != null}">
    <div style="text-align: right;  " >欢迎 您: [<span style="color:red;" th:text="${session.user.name}" > </span> ] 登录, <a th:href="@{/userexit}"  >安全登出</a> &nbsp;&nbsp; <a th:href="@{/adminlogin}"  >进入后台</a> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </div>
</span>
</div>
</body>
</html>